<?php
namespace Home\Controller;
use Think\Controller;
use Think\Model;


class WwfController extends Controller {
	public function index(){
		echo 'hello,Wwfthinkphp!';
	    $this->assign('user','wwf index');
		$this->display();
	}
	 public function mode(){
		//$user=new Model('user');
		//print_r($user->select());
	 	$user = M('User');
	 	$temp1="樱桃小丸子";
	 	$temp2="123";
	 	//thinkPhp 使用变量查询的书写格式
	 	
	 	$date=$user->where("user='$temp1' AND password='$temp2'")->select();
	 	var_dump($date);
	 	if ($date)
	 	{
	 	    //print_r($date);
	 	    echo $date[0][per];
	 	}else {
	 		echo "用户或者密码不正确";
	 	}
	}  
	public function view(){
		 $this->display();
	}
}
